//newton search or Binary search between [0,x/2+1]
class Solution{
public:
    int sqrt(int x){
        if(x == 0) return 0;
        double last = 0;
        double res = 1;
        while(res != last)
        {
            last = res;
            res = (res + x/res)/2;
        }
    }
}
